From: Alessandro Bono Date: Tue, 16 Jun 2026 08:47:10 +0000 (+0200) Subject: background: Handle promise rejection from _loadFile() X-Git-Tag: archive/raspbian/50.5-1+rpi1^2~14^2^2~5 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=58441f7abd01fd35027d5b96f9ef46a414268326;p=gnome-shell.git background: Handle promise rejection from _loadFile() This suppresses the following: ``` (gnome-shell:11243): Gjs-WARNING **: 19:15:39.498: Unhandled promise rejection. To suppress this warning, add an error handler to your promise chain with .catch() or a try-catch block around your await expression. Stack trace of the failed promise: _loadFile@resource:///org/gnome/shell/ui/background.js:501:20 _load@resource:///org/gnome/shell/ui/background.js:531:14 _init@resource:///org/gnome/shell/ui/background.js:288:14 Background@resource:///org/gnome/shell/ui/background.js:244:4 getBackground@resource:///org/gnome/shell/ui/background.js:635:30 _createBackgroundActor@resource:///org/gnome/shell/ui/background.js:807:49 _updateBackgroundActor@resource:///org/gnome/shell/ui/background.js:779:39 _createBackgroundActor/changeSignalId<@resource:///org/gnome/shell/ui/background.js:835:18 _emitChangedSignal/this._changedIdleId<@resource:///org/gnome/shell/ui/background.js:321:18 @resource:///org/gnome/shell/ui/init.js:21:20 ``` Part-of: (cherry picked from commit 1a9df2b07371116c25bf0751767377df75cbaf6c) --- diff --git a/js/ui/background.js b/js/ui/background.js index 09edeb1be..aa38f854c 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -518,7 +518,7 @@ const Background = GObject.registerClass({ return; } - this._loadFile(this._file); + this._loadFile(this._file).catch(logError); } });